package cn.qidisoft.edu.hzjt.constants;

import cn.qidisoft.core.common.context.ApplicationContextConfigUtil;
import cn.qidisoft.core.util.StringUtils;
import cn.qidisoft.core.web.util.WebConstants;

/**
 * 常量类
 * 
 * @author kevin.huang
 * @version 1.0
 */
public final class Constant extends WebConstants {

  /** 前台用户 */
  public static final String LOGIN_FORE_USER = "_login_fore_user";

  /** 后台用户 */
  public static final String LOGIN_CONSOLE_USER = "_login_console_user";
  /** 用户类型 **/
  public static final String LOGIN_USER_TYPE = "_login_user_type";
  /** 用户类型是学生标识 **/
  public static final Integer USER_TYPE_STUDENT = 1;
  /** 用户类型是老师标识 **/
  public static final Integer USER_TYPE_TEACHER = 2;
  /** 是否是管理员 1 是 0 否 **/
  public static final Integer IS_ADMIN = 1;
  /** 新增权限 **/
  public static final String PERMISSTION_ADD = "CanCreate";
  /** 修改权限 **/
  public static final String PERMISSTION_MODIFY = "CanCreate";
  /** 删除权限 **/
  public static final String PERMISSTION_DELETE = "CanModify";
  /** 提交权限 **/
  public static final String PERMISSTION_SUBMIT = "CanSubmit";
  /** 审核权限 **/
  public static final String PERMISSTION_CHECK = "CanCheck";
  /** 其他权限 **/
  public static final String PERMISSTION_OTHER = "CanOther";
  /** 页面数据集合 */
  public static final String PAGED_LIST_HOLDER = "_paged_list_holder";
  public static final Integer PageSize = 50;
  /** 初始分页数 */
  public static final String PAGE_SIZE = "pageSize";

  /** 当前页 */
  public static final String CURRENT_PAGE = "currentPage";

  /** 查询动作 */
  public static final String SEARCH_ACTION = "search_action";

  /** 降序排序 */
  public static final String ORDER_MODE_DESC = "desc";

  /** 升序排序 */
  public static final String ORDER_MODE_ASC = "asc";

  /** 管理员 **/
  public static final String IS_MANAGER = "0";
  /** 老师 **/
  public static final String IS_BZR = "1";

  /** 学生端 **/
  public static final String IS_STUDENT = "2";

  /** 行为达标生 **/
  public static final Double STUDENT_XWDB = 0.8;
  /** 好学生 **/
  public static final Double STUDENT_HXS = 0.15;
  /** 三好学生 **/
  public static final Double STUDENT_SHXS = 0.15;

  /** 政治面貌代码 **/
  public static final String ZZMM_CODE = "GB/T4762";
  /** 民族 **/
  public static final String MZ_CODE = "GB/T3304-1991";

  public static final String PXXM_TYPE1 = "三好学生";
  public static final String PXXM_TYPE2 = "好学生";
  public static final String PXXM_TYPE3 = "行为达标生";
  public static final String PXXM_TYPE4 = "优秀班干部";
  public static final String PXXM_TYPE5 = "技能特长生";

  /** 导入是否成功 */
  public static final String All_SUCESS = "全部成功";
  public static final String PART_SUCESS = "部分成功";
  public static final String ALL_FAIL = "全部失败";
  /** 异常处理对象 **/
  public static final String EXPTION_MSG_KEY = "exception";
  // 流程钥匙
  public static String WS_FLOW_SERVICE_KEY = null;
  /** 安全验证地址合法性 **/
  public static String[] VERFITY_REMOTE_URLS = null;
  /** 登录验证失败跳转地址 **/
  public static String REDIRECT_LOGIN_URL = null;
  /** 上传下载资源地址 **/
  public static String UPLOADPATH = null;
  /** 上传资源文件(行政论坛投稿)目录 **/
  public static final String CONTRIBUTIONATT_RESOURCE = "contributionAttr";
  /** 上传资源文件(年度科研作业)目录 **/
  public static final String CONTRIBUTIONATT_RESOURCE2 = "scientificJob";
  /** 上传资源文件(业余团校)目录 **/
  public static final String CONTRIBUTIONATT_RESOURCE_TX = "communityAmateurSchoolAtt";
  /** 上传资源文件(业余团校作业)目录 老师端 **/
  public static final String CONTRIBUTIONATT_RESOURCE_TX_ZY = "communityAmateurHomewk";
  /** 上传资源文件(业余团校作业)目录 学生端 **/
  public static final String CONTRIBUTIONATT_RESOURCE_TX_ZYStudent =
      "communityAmateurHomewkStudent";

  static {
    WS_FLOW_SERVICE_KEY = ApplicationContextConfigUtil.getString("serviceFlowKey", null);
    REDIRECT_LOGIN_URL = ApplicationContextConfigUtil.getString("redirectLoginUrl", null);
    if (!StringUtils
        .isNullValue(ApplicationContextConfigUtil.getString("verfityRemoteUrls", null))) {
      VERFITY_REMOTE_URLS =
          ApplicationContextConfigUtil.getString("verfityRemoteUrls", null).split(",");
    }
    UPLOADPATH = ApplicationContextConfigUtil.getString("file.path", null);

  }

}
